package com.zr.Paydivide.mapper;

import com.zr.Paydivide.pojo.PayDivideAddVo;
import com.zr.Paydivide.pojo.PaydivideShowVo;
import com.zr.Paydivide.pojo.UserRepay;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


/**
 * Created by star on 2019/7/3.
 */
@Mapper
public interface PaydivideMapper {

    @Select("select p.amountInstallments,p.paymentCycle,p.classHours,p.myCourse,u.`name`,u.idCode,r.bankCardAccount,r.openingBank from paymentInformation p\n" +
            "LEFT JOIN  userInfo u on u.loginId=p.loginId\n" +
            "LEFT JOIN userRepay r on r.loginId=p.loginId\n" +
            "where p.loginId=#{loginId}")
    PaydivideShowVo findByLoginId(Integer loginId);


    @Insert("insert into paydivide (loginId,amountSettlement,paymentAccount,startTime,firstPayMentDate,name," +
            "idCode,payMentDate,paymentCycle,backBank,agreement,myCourse,createTime,createName,updateTime," +
            "updateName) values (#{loginId},#{amountSettlement},#{paymentAccount},#{startTime},#{firstPayMentDate},#{name},#{idCode}," +
            "#{payMentDate},#{paymentCycle},#{backBank},#{agreement},#{myCourse},#{createTime},#{createName},#{updateTime},#{updateName}) ")
    int payDivideAdd(PayDivideAddVo payDivideAddVo);





   /* @Select("select p.amountInstallments,p.paymentCycle,p.classHours,p.myCourse,u.name,u.idCode,r.bankCardAccount,r.openingBank from " +
            "paymentinformation p LEFT JOIN userinfo u on u.loginId=p.loginId LEFT JOIN userrepay r on r.loginId=p.loginId WHERE u.loginId=#{loginId}")
    PaydivideShowVo findByLoginId(Integer loginId);

    @Insert("insert into paydivide (id,loginId,amountSettlement,paymentAccount,startTime,firstPayMentDate,name,idCode,payMentDate,paymentCycle,backBank,agreement,myCourse,createTime,createName,updateTime,updateName) values (#{id},#{loginId},#{amountSettlement},#{paymentAccount},#{startTime},#{firstPayMentDate},#{name},#{idCode},#{payMentDate}," +
            "#{paymentCycle},#{backBank},#{agreement},#{myCourse},#{createTime},#{createName},#{updateTime},#{updateName})")
    int addfindByLoginId(PaydivideShowVo paydivideShowVo);

    @Select("select bankCardAccount,openingBank,bankPhone from userrepay where id=#{id}")
    UserRepay queryByUserrepay(Integer id);*/


}

